<template>
    <el-drawer :title="drawerOption.title" :with-header="drawerOption.withHeader"
               :before-close="handleClose" :visible.sync="drawerOption.visible"
               :direction="drawerOption.direction" :size="drawerOption.size"
               custom-class="client_drawer" ref="drawer"
               :modal="drawerOption.modal" :append-to-body="drawerOption.appendToBody"
               style="position: absolute" :wrapperClosable="false">
    </el-drawer>
</template>

<script>
export default {
    name: "SupplierDrawer",
    props: {
        options: {
            type: Object,
            default() {
                return {};
            },
        },
    },
    data() {
        return {
            drawerOption: {},
            defaultOption: {
                title: "",
                visible: false,
                size: "60%",
                direction: "rtl",
                withHeader: false,
                modal: false,
                appendToBody: false, //true ,
            },
        };
    },
    methods: {
        handleClose(done) {
            const _this = this;
            if (_this.$route.path !== "/sysClients" && _this.form.sid) {
                $this.$emit("event", { type: "add", data: this.form });
            }
            _this.$emit("event", {
                type: "refresh",
            });
            done();
        },
    },
}
</script>

<style scoped>

</style>